package io.github.siltal.examsystembackend.dto;

// 可以用 record (Java 16+) 来简化，或者普通的 class
public record PasswordChangeResponse(
        Boolean ok,
        String error
) {
    public static PasswordChangeResponse success() {
        return new PasswordChangeResponse(true, "");
    }

    public static PasswordChangeResponse userNotFound() {
        return new PasswordChangeResponse(false, "用户不存在");
    }

    public static PasswordChangeResponse passwordIncorrect() {
        return new PasswordChangeResponse(false, "密码不正确");
    }

    public static PasswordChangeResponse PasswordLengthError() {
        return new PasswordChangeResponse(false, "密码应当在8到20个字符之间");
    }

}

